{% extends 'base.html' %}
{% load static %}

{% block 'title' %}商品详情{% endblock%}
{% block 'header-title' %}商品详情{% endblock%}
{% block 'content' %}
    <div class="container">
        <h1>{{product.title}}</h1>
        <p>价格：${{product.price}}</p>
        <div style="text-indent:2em;">
            <!-- {{product.detail|linebreaks}} -->
            {% for line in product.detail.splitlines %}
                <p>{{line}}</p>
            {% endfor %}
        </div>

        {% include 'message.html' %}
        <form method="post" accept="{% url 'show' product.pk %}" class="form-inline ml-3">
            {% csrf_token %}
            
            <div class="form-group row">
                <div class="input-group mb-2">
                    <div class="input-group-prepend">
                    <div class="input-group-text">数量</div>
                    </div>
                    <input type="number" class="form-control" name="count" id="count" value="1" min="1">
                    <button type="submit" class="btn btn-primary">添加到购物车</button>
                </div>
            </div>
        </form>
    </div>
{% endblock %}